package com.itheima.pattern.observer.demo;

import java.util.Observable;

public class Thief extends Observable {

    private String name;

    public Thief(String name) {
        this.name = name;

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void steal(){
        System.out.println("小偷在偷盗");
        super.setChanged();//changed = true;
        super.notifyObservers();
    }


}
